# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DFAReporting.V4.Model.OfflineUserAddressInfo do
  @moduledoc """
  Identify a user by name and address.

  ## Attributes

  *   `city` (*type:* `String.t`, *default:* `nil`) - City of the address.
  *   `countryCode` (*type:* `String.t`, *default:* `nil`) - 2-letter country code in ISO-3166-1 alpha-2 of the user's address.
  *   `hashedFirstName` (*type:* `String.t`, *default:* `nil`) - First name of the user, which is hashed as SHA-256 after normalized (Lowercase all characters; Remove any extra spaces before, after, and in between).
  *   `hashedLastName` (*type:* `String.t`, *default:* `nil`) - Last name of the user, which is hashed as SHA-256 after normalized (lower case only and no punctuation).
  *   `hashedStreetAddress` (*type:* `String.t`, *default:* `nil`) - The street address of the user hashed using SHA-256 hash function after normalization (lower case only).
  *   `postalCode` (*type:* `String.t`, *default:* `nil`) - Postal code of the user's address.
  *   `state` (*type:* `String.t`, *default:* `nil`) - State code of the address.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :city => String.t() | nil,
          :countryCode => String.t() | nil,
          :hashedFirstName => String.t() | nil,
          :hashedLastName => String.t() | nil,
          :hashedStreetAddress => String.t() | nil,
          :postalCode => String.t() | nil,
          :state => String.t() | nil
        }

  field(:city)
  field(:countryCode)
  field(:hashedFirstName)
  field(:hashedLastName)
  field(:hashedStreetAddress)
  field(:postalCode)
  field(:state)
end

defimpl Poison.Decoder, for: GoogleApi.DFAReporting.V4.Model.OfflineUserAddressInfo do
  def decode(value, options) do
    GoogleApi.DFAReporting.V4.Model.OfflineUserAddressInfo.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.DFAReporting.V4.Model.OfflineUserAddressInfo do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
